<!doctype html>
<html class="html-passport-register">

<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width,user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0" />
    <title>风云呼</title>
    <link rel="stylesheet"
          type="text/css"
          href="./skin/css/bootstrap.min.css?v=1.0.0" />
    <link rel="stylesheet"
          type="text/css"
          href="./skin/css/font-awesome.min.css?v=1.0.0" />
    <link rel="stylesheet"
          type="text/css"
          href="./skin/icon/iconfont.css?v=2" />
    <link rel="stylesheet"
          type="text/css"
          href="./skin/css/common.css?v=2" />
    <link rel="stylesheet"
          type="text/css"
          href="./skin/css/member.css?v=6" />

</head>

<body class="body-passport-register disabled-footer">
    <div class="phone-box">

        <header class="header">
            <a class="header-left box-center"
               href="javascript:history.go(-1);">
                <i class="fa fa-angle-left fa-2x"></i>
            </a>
            <div class="header-right">
                <!-- <a href="javascript:void(0);"
                   id="customerServiceBtn">
                    <i class="fa fa-commenting-o"></i>
                    客服
                </a> -->
            </div>
            <div class="header-center box-center">帐号注册</div>
        </header>
        <div class="container">
            <div class="header-line"></div>
            <div class="page-body">

                <div class="row">
                    <div class="padding-30">
                        <div class="no-padding-top">
                            <div class="space-10"></div>
                            <div class="logo"
                                 style="visibility: hidden;">
                                <img src="http://www.znyh123.com/skin/images/logo.jpeg" />
                            </div>
                            <div class="space-20"></div>
                            <div class="space-20"></div>
                            <form class="form-horizontal"
                                  onsubmit="return false"
                                  id="post">
                                <div class="form-group-line padding-10 no-padding-left no-padding-right">
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-user width-16 text-blue"></i>
                                        </div>
                                        <input type="text"
                                               id="username"
                                               class="form-control no-padding-left"
                                               placeholder="请输入账号，限英文数字下划线">
                                    </div>
                                </div>
                                <div class="form-group-line padding-10 no-padding-left no-padding-right">
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-lock width-16 text-blue"></i>
                                        </div>
                                        <input type="password"
                                               id="password"
                                               class="form-control no-padding-left"
                                               placeholder="设置登录密码，6-16位字符串">
                                    </div>
                                </div>
                                <div class="form-group-line padding-10 no-padding-left no-padding-right">
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-lock width-16 text-blue"></i>
                                        </div>
                                        <input type="password"
                                               id="confirm_password"
                                               class="form-control no-padding-left"
                                               placeholder="再次输入密码以确认">
                                    </div>
                                </div>
                                <div class="form-group-line padding-10 no-padding-left no-padding-right">
                                    <div class="input-group">
                                        <div class="input-group-addon">
                                            <i class="fa fa-qq width-16 text-blue"></i>
                                        </div>
                                        <input type="tel"
                                               id="card_num"
                                               class="form-control no-padding-left"
                                               placeholder="输入卡密">
                                    </div>
                                </div>

                                <div class="space-5"></div>
                                <div class="padding-10 no-padding-left no-padding-right">
                                    <button id="submit"
                                            class="btn btn-info btn-lg btn-block">立即注册</button>
                                </div>
                                <div class="space-10"></div>
                                <div class="form-group text-center">
                                    <a href="./login.html">
                                        返回登录
                                    </a>
                                </div>
                            </form>
                        </div>

                    </div>
                </div>

            </div>
        </div>
    </div>
    <script type="text/javascript"
            src="./data/plugin/jquery/jquery.min.js?v=1.0.0"></script>
    <script type="text/javascript"
            src="./data/plugin/ui/js/bootstrap.min.js"></script>
    <script type="text/javascript"
            src="./skin/js/layer/layer.min.js?v=1.0.0"></script>
    <script type="text/javascript"
            src="./skin/js/common.js?v=4444"></script>
    <script>
        $(function () {
            $('#customerServiceBtn').on('click', function () {
                var customerServicePop = layer.open({
                    className: 'customer-service-pop',
                    content: '<div class="border-sizing">' +
                        '   <div class="col-xs-6">' +
                        '       <i class="server-wechat"></i>' +
                        '       <span>雷神短信已经上线</span>' +
                        '   </div>' +
                        '   <div class="col-xs-6">' +
                        '       <i class="server-qq"></i>' +
                        '       <a href="http://wpa.qq.com/msgrd?v=3&uin=123456&site=qq&menu=yes" target="_blank">123456</a>' +
                        '   </div>' +
                        '   <div class="clearfix"></div>' +
                        '</div>' +
                        '<a id="closeCustomerServiceBtn" class="fa fa-times-circle-o fa-2x text-blue"></a>',
                    success: function () {
                        $('#closeCustomerServiceBtn').on('click', function () {
                            layer.close(customerServicePop);
                        });
                    }
                });
            });

            bParseResult.bindCode('3010001', 1, function (requestCode, json) {
                bDialog.alert(json.message, function () {
                    self.location.href = 'http://www.znyh123.com/abc/45/?m=buy&a=index';
                });

                return false;
            });

            bParseResult.bindCode('3010000', 1, function (requestCode, json) {
                bDialog.alert(json.message, function () {
                    self.location.href = 'http://www.znyh123.com/abc/45/?m=passport&a=login';
                });

                setTimeout(function () {
                    self.location.href = 'http://www.znyh123.com/abc/45/?m=passport&a=login';
                }, 3000);

                return false;
            });
        });
    </script>
    <script src="./fetch.js"></script>
    <script>
        $(function () {
            $('#submit').on('click', function () {
                let username = $('#username').val()
                let password = $('#password').val()
                let confirm_password = $('#confirm_password').val()
                let is_call = true
                let is_agent = false
                let card_num = $('#card_num').val()
                if (password !== confirm_password) {
                    alert('两次密码不一致')
                } else {
                    $http('/api/userregister/', { username, password, is_call, is_agent, card_num }).then(res => {
                        if (res.succ === '注册成功') {
                            alert('注册成功,即将跳转到登录页面')
                            window.location.href = './login.html'
                        } else {
                            alert(res.error)
                        }
                    })
                }
            })
            // $('#verify').changeVerify();
            // $('#post').autoSubmit(null, null, function (json) {
            //     bDialog.toastSuccessGoUrl(json.message, json.url);
            // });
        });
    </script>

</body>

</html>
